<template>
<!-- 面包屑组件 -->
  <XtxBread >
    <XtxBreadItem to="/">首页</XtxBreadItem>
    <XtxBreadItem :to="`/category/${subCate.parentId}`">{{subCate.parentName}}</XtxBreadItem>
    <transition name="fade-right" mode="out-in">
      <XtxBreadItem :key="subCate.id">{{subCate.name}}</XtxBreadItem>
    </transition>
  </XtxBread>
</template>

<script>
import { inject } from 'vue'
export default {
  name: 'SubBread',
  setup () {
    //   后代组件通过inject 接收数据
    const subCate = inject('subCate')
    // console.log(1111)
    return { subCate }
  }
}
</script>

<style>

</style>
